<% extends "common/msui.html" %>
<% block title %>首页<% endblock %>
<% block body %>
<div class="page" id='products-old'>
  <header class="bar bar-nav">
    <a class="icon icon-cart pull-right" href='/mshop/shopping_cart'></a>
    <h1 class="title">东方团购中心</h1>
    <a class="button button-link button-nav pull-left back" href="/mshop/index" >
      <span class="icon icon-left"></span>
      返回
    </a>
  </header>

  <div class="content">
    <!-- 这里是页面内容区 -->
    <% set product_model = _pool.get('product.template') %>
    <% set products = product_model.search([('company_id', '=', 1), ('sale_ok', '=', True), ('type', '!=', 'service')]) %>

    <div class="page-index">
    <% for product_id in products %>
      <% set product = product_model.read(product_id, ['name', 'description_sale', 'lst_price']) %>
      <a href="/mshop/product/${product.id}">
        <div class="card">
          <div class="card-content">
            <div class="list-block media-list">
              <ul>
                <li class="item-content">
                  <div class="item-media">
                      <img width="80" height="80" src="/website/image/product.template/${product.id}/image" />
                  </div>
                  <div class="item-inner product-list-desc">
                    <div class="item-title-row">
                      <div class="item-title">${product.name}</div>
                      <div class='item-after' style='color:red'>￥${product.lst_price}</div>
                    </div>
                    <div class="item-subtitle">${product.description_sale}</div>
                  </div>
                </li>
              </ul>
            </div>

          </div>
  <!--         <div class="card-footer">
            <a href="#" class="link">赞</a>
            <a href="/mshop/product/${product.id}" class="link open-indicator">详细</a>
          </div> -->
        </div>
      </a>
    <% endfor %>
    </div>
  </div>

  <footer>
    <nav class="bar bar-tab index-footer">
      <a class="tab-item" href="/mshop/index">
        <span class="icon icon-home"></span>
        <span class="tab-label">首页</span>
      </a>
      <a class="tab-item" href="/mshop/shopping_cart">
        <span class="icon icon-cart"></span>
        <span class="tab-label">购物车</span>
      </a>
      <a class="tab-item" href="/mshop/my">
        <span class="icon icon-me"></span>
        <span class="tab-label">我的</span>
        <!-- <span class="badge">2</span> -->
      </a>
    </nav>
  </footer>
  
</div>

  <script type="application/javascript">
      // open-indicator样式点击显示加载指示器
      $(document).on('click','.open-indicator', function () {
          $.showIndicator();
      });
  </script>
<% endblock %>